# akshare_finance/models.py
from dataclasses import dataclass, field
from typing import List


@dataclass
class Company:
    symbol: str
    name: str


@dataclass
class Sector:
    name: str
    companies: List[Company] = field(default_factory=list)

    def add_company(self, company: Company) -> None:
        self.companies.append(company)

    def add_companies(self, companies: List[Company]) -> None:
        self.companies.extend(companies)
